
#include "Levels.h"

Levels::Levels(TileManager* tma)
{
	tm = tma;
}


Levels::~Levels(void)
{
}

void Levels::startLevel1()//problem with this method is that it spawns unnecessary extra objects. should be able to create four wall objects and have multiple pointers to them, since a wall is a wall.
{
	//creates an empty room. the tiles are set properly so that they are seeamless in the corners.

	//should be able to repurpose this method ,
	//so that I can give it coordinates and have it spawn
	//a room on the screen within those bounds.
	 Floor * floor = new Floor(tm);
	tm->applyFloor(floor);
	 
	for(int i =0; i <TileManager::NUM_TILES_X ; i++)
	{
		for (int j = 0; j < TileManager::NUM_TILES_Y ; j++)
		{
			if(i==0)//left side
			{
				if(j==0) //top left corner
				{
					tm->spawn(new Wall(i,j,tm,742) , i , j );
				}
				else if(j==TileManager::NUM_TILES_Y-1) //bottom left corner
				{
					
					tm->spawn(new Wall(i,j,tm,744) , i , j );

				}
				else
				{

					
					tm->spawn(new Wall(i,j,tm,740) , i , j );
				}
			}
			else if(i==TileManager::NUM_TILES_X-1)//right
			{
				if(j==0) //top right corner
				{
					
					tm->spawn(new Wall(i,j,tm,743) , i , j );
				}
				else if(j==TileManager::NUM_TILES_Y-1) //bottom right corner
				{
					
					tm->spawn(new Wall(i,j,tm,745) , i , j );

				}
				else
				{
					
					tm->spawn(new Wall(i,j,tm,740) , i , j );
				}
			}
			else{
				if(j==TileManager::NUM_TILES_Y-1 || j== 0)
				{
					
					tm->spawn(new Wall(i,j,tm,741) , i , j );
				}

			}
			
			
		}

	}

}